3.2.40 \(\int \frac {(a+b \log (c x^n))^2 \log (d (e+f x^m)^r)}{x} \, dx\) [140]

Optimal. Leaf size=150 \[ \frac {\left (a+b \log \left (c x^n\right )\right )^3 \log \left (d \left (e+f x^m\right )^r\right )}{3 b n}-\frac {r \left (a+b \log \left (c x^n\right )\right )^3 \log \left (1+\frac {f x^m}{e}\right )}{3 b n}-\frac {r \left (a+b \log \left (c x^n\right )\right )^2 \text {Li}_2\left (-\frac {f x^m}{e}\right )}{m}+\frac {2 b n r \left (a+b \log \left (c x^n\right )\right ) \text {Li}_3\left (-\frac {f x^m}{e}\right )}{m^2}-\frac {2 b^2 n^2 r \text {Li}_4\left (-\frac {f x^m}{e}\right )}{m^3} \]

[Out]

1/3*(a+b*ln(c*x^n))^3*ln(d*(e+f*x^m)^r)/b/n-1/3*r*(a+b*ln(c*x^n))^3*ln(1+f*x^m/e)/b/n-r*(a+b*ln(c*x^n))^2*poly
log(2,-f*x^m/e)/m+2*b*n*r*(a+b*ln(c*x^n))*polylog(3,-f*x^m/e)/m^2-2*b^2*n^2*r*polylog(4,-f*x^m/e)/m^3

________________________________________________________________________________________

Rubi [A]
time = 0.17, antiderivative size = 150, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {2422, 2375, 2421, 2430, 6724} \begin {gather*} \frac {2 b n r \text {PolyLog}\left (3,-\frac {f x^m}{e}\right ) \left (a+b \log \left (c x^n\right )\right )}{m^2}-\frac {r \text {PolyLog}\left (2,-\frac {f x^m}{e}\right ) \left (a+b \log \left (c x^n\right )\right )^2}{m}-\frac {2 b^2 n^2 r \text {PolyLog}\left (4,-\frac {f x^m}{e}\right )}{m^3}+\frac {\left (a+b \log \left (c x^n\right )\right )^3 \log \left (d \left (e+f x^m\right )^r\right )}{3 b n}-\frac {r \log \left (\frac {f x^m}{e}+1\right ) \left (a+b \log \left (c x^n\right )\right )^3}{3 b n} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((a + b*Log[c*x^n])^2*Log[d*(e + f*x^m)^r])/x,x]

[Out]

((a + b*Log[c*x^n])^3*Log[d*(e + f*x^m)^r])/(3*b*n) - (r*(a + b*Log[c*x^n])^3*Log[1 + (f*x^m)/e])/(3*b*n) - (r
*(a + b*Log[c*x^n])^2*PolyLog[2, -((f*x^m)/e)])/m + (2*b*n*r*(a + b*Log[c*x^n])*PolyLog[3, -((f*x^m)/e)])/m^2
- (2*b^2*n^2*r*PolyLog[4, -((f*x^m)/e)])/m^3

Rule 2375

Int[(((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.))/((d_) + (e_.)*(x_)^(r_)), x_Symbol] :> Si
mp[f^m*Log[1 + e*(x^r/d)]*((a + b*Log[c*x^n])^p/(e*r)), x] - Dist[b*f^m*n*(p/(e*r)), Int[Log[1 + e*(x^r/d)]*((
a + b*Log[c*x^n])^(p - 1)/x), x], x] /; FreeQ[{a, b, c, d, e, f, m, n, r}, x] && EqQ[m, r - 1] && IGtQ[p, 0] &
& (IntegerQ[m] || GtQ[f, 0]) && NeQ[r, n]

Rule 2421

Int[(Log[(d_.)*((e_) + (f_.)*(x_)^(m_.))]*((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.))/(x_), x_Symbol] :> Simp
[(-PolyLog[2, (-d)*f*x^m])*((a + b*Log[c*x^n])^p/m), x] + Dist[b*n*(p/m), Int[PolyLog[2, (-d)*f*x^m]*((a + b*L
og[c*x^n])^(p - 1)/x), x], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IGtQ[p, 0] && EqQ[d*e, 1]

Rule 2422

Int[(Log[(d_.)*((e_) + (f_.)*(x_)^(m_.))^(r_.)]*((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.))/(x_), x_Symbol] :
> Simp[Log[d*(e + f*x^m)^r]*((a + b*Log[c*x^n])^(p + 1)/(b*n*(p + 1))), x] - Dist[f*m*(r/(b*n*(p + 1))), Int[x
^(m - 1)*((a + b*Log[c*x^n])^(p + 1)/(e + f*x^m)), x], x] /; FreeQ[{a, b, c, d, e, f, r, m, n}, x] && IGtQ[p,
0] && NeQ[d*e, 1]

Rule 2430

Int[(((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*PolyLog[k_, (e_.)*(x_)^(q_.)])/(x_), x_Symbol] :> Simp[PolyLo
g[k + 1, e*x^q]*((a + b*Log[c*x^n])^p/q), x] - Dist[b*n*(p/q), Int[PolyLog[k + 1, e*x^q]*((a + b*Log[c*x^n])^(
p - 1)/x), x], x] /; FreeQ[{a, b, c, e, k, n, q}, x] && GtQ[p, 0]

Rule 6724

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rubi steps

\begin {align*} \int \frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (d \left (e+f x^m\right )^r\right )}{x} \, dx &=\frac {\left (a+b \log \left (c x^n\right )\right )^3 \log \left (d \left (e+f x^m\right )^r\right )}{3 b n}-\frac {(f m r) \int \frac {x^{-1+m} \left (a+b \log \left (c x^n\right )\right )^3}{e+f x^m} \, dx}{3 b n}\\ &=\frac {\left (a+b \log \left (c x^n\right )\right )^3 \log \left (d \left (e+f x^m\right )^r\right )}{3 b n}-\frac {r \left (a+b \log \left (c x^n\right )\right )^3 \log \left (1+\frac {f x^m}{e}\right )}{3 b n}+r \int \frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+\frac {f x^m}{e}\right )}{x} \, dx\\ &=\frac {\left (a+b \log \left (c x^n\right )\right )^3 \log \left (d \left (e+f x^m\right )^r\right )}{3 b n}-\frac {r \left (a+b \log \left (c x^n\right )\right )^3 \log \left (1+\frac {f x^m}{e}\right )}{3 b n}-\frac {r \left (a+b \log \left (c x^n\right )\right )^2 \text {Li}_2\left (-\frac {f x^m}{e}\right )}{m}+\frac {(2 b n r) \int \frac {\left (a+b \log \left (c x^n\right )\right ) \text {Li}_2\left (-\frac {f x^m}{e}\right )}{x} \, dx}{m}\\ &=\frac {\left (a+b \log \left (c x^n\right )\right )^3 \log \left (d \left (e+f x^m\right )^r\right )}{3 b n}-\frac {r \left (a+b \log \left (c x^n\right )\right )^3 \log \left (1+\frac {f x^m}{e}\right )}{3 b n}-\frac {r \left (a+b \log \left (c x^n\right )\right )^2 \text {Li}_2\left (-\frac {f x^m}{e}\right )}{m}+\frac {2 b n r \left (a+b \log \left (c x^n\right )\right ) \text {Li}_3\left (-\frac {f x^m}{e}\right )}{m^2}-\frac {\left (2 b^2 n^2 r\right ) \int \frac {\text {Li}_3\left (-\frac {f x^m}{e}\right )}{x} \, dx}{m^2}\\ &=\frac {\left (a+b \log \left (c x^n\right )\right )^3 \log \left (d \left (e+f x^m\right )^r\right )}{3 b n}-\frac {r \left (a+b \log \left (c x^n\right )\right )^3 \log \left (1+\frac {f x^m}{e}\right )}{3 b n}-\frac {r \left (a+b \log \left (c x^n\right )\right )^2 \text {Li}_2\left (-\frac {f x^m}{e}\right )}{m}+\frac {2 b n r \left (a+b \log \left (c x^n\right )\right ) \text {Li}_3\left (-\frac {f x^m}{e}\right )}{m^2}-\frac {2 b^2 n^2 r \text {Li}_4\left (-\frac {f x^m}{e}\right )}{m^3}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(741\) vs. \(2(150)=300\).
time = 0.21, size = 741, normalized size = 4.94 \begin {gather*} -\frac {1}{3} a b m n r \log ^3(x)+\frac {1}{4} b^2 m n^2 r \log ^4(x)-\frac {1}{3} b^2 m n r \log ^3(x) \log \left (c x^n\right )-a b n r \log ^2(x) \log \left (1+\frac {e x^{-m}}{f}\right )+\frac {2}{3} b^2 n^2 r \log ^3(x) \log \left (1+\frac {e x^{-m}}{f}\right )-b^2 n r \log ^2(x) \log \left (c x^n\right ) \log \left (1+\frac {e x^{-m}}{f}\right )-a^2 r \log (x) \log \left (e+f x^m\right )+2 a b n r \log ^2(x) \log \left (e+f x^m\right )-b^2 n^2 r \log ^3(x) \log \left (e+f x^m\right )+\frac {a^2 r \log \left (-\frac {f x^m}{e}\right ) \log \left (e+f x^m\right )}{m}-\frac {2 a b n r \log (x) \log \left (-\frac {f x^m}{e}\right ) \log \left (e+f x^m\right )}{m}+\frac {b^2 n^2 r \log ^2(x) \log \left (-\frac {f x^m}{e}\right ) \log \left (e+f x^m\right )}{m}-2 a b r \log (x) \log \left (c x^n\right ) \log \left (e+f x^m\right )+2 b^2 n r \log ^2(x) \log \left (c x^n\right ) \log \left (e+f x^m\right )+\frac {2 a b r \log \left (-\frac {f x^m}{e}\right ) \log \left (c x^n\right ) \log \left (e+f x^m\right )}{m}-\frac {2 b^2 n r \log (x) \log \left (-\frac {f x^m}{e}\right ) \log \left (c x^n\right ) \log \left (e+f x^m\right )}{m}-b^2 r \log (x) \log ^2\left (c x^n\right ) \log \left (e+f x^m\right )+\frac {b^2 r \log \left (-\frac {f x^m}{e}\right ) \log ^2\left (c x^n\right ) \log \left (e+f x^m\right )}{m}+a^2 \log (x) \log \left (d \left (e+f x^m\right )^r\right )-a b n \log ^2(x) \log \left (d \left (e+f x^m\right )^r\right )+\frac {1}{3} b^2 n^2 \log ^3(x) \log \left (d \left (e+f x^m\right )^r\right )+2 a b \log (x) \log \left (c x^n\right ) \log \left (d \left (e+f x^m\right )^r\right )-b^2 n \log ^2(x) \log \left (c x^n\right ) \log \left (d \left (e+f x^m\right )^r\right )+b^2 \log (x) \log ^2\left (c x^n\right ) \log \left (d \left (e+f x^m\right )^r\right )+\frac {b n r \log (x) \left (-b n \log (x)+2 \left (a+b \log \left (c x^n\right )\right )\right ) \text {Li}_2\left (-\frac {e x^{-m}}{f}\right )}{m}+\frac {r \left (a-b n \log (x)+b \log \left (c x^n\right )\right )^2 \text {Li}_2\left (1+\frac {f x^m}{e}\right )}{m}+\frac {2 a b n r \text {Li}_3\left (-\frac {e x^{-m}}{f}\right )}{m^2}+\frac {2 b^2 n r \log \left (c x^n\right ) \text {Li}_3\left (-\frac {e x^{-m}}{f}\right )}{m^2}+\frac {2 b^2 n^2 r \text {Li}_4\left (-\frac {e x^{-m}}{f}\right )}{m^3} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((a + b*Log[c*x^n])^2*Log[d*(e + f*x^m)^r])/x,x]

[Out]

-1/3*(a*b*m*n*r*Log[x]^3) + (b^2*m*n^2*r*Log[x]^4)/4 - (b^2*m*n*r*Log[x]^3*Log[c*x^n])/3 - a*b*n*r*Log[x]^2*Lo
g[1 + e/(f*x^m)] + (2*b^2*n^2*r*Log[x]^3*Log[1 + e/(f*x^m)])/3 - b^2*n*r*Log[x]^2*Log[c*x^n]*Log[1 + e/(f*x^m)
] - a^2*r*Log[x]*Log[e + f*x^m] + 2*a*b*n*r*Log[x]^2*Log[e + f*x^m] - b^2*n^2*r*Log[x]^3*Log[e + f*x^m] + (a^2
*r*Log[-((f*x^m)/e)]*Log[e + f*x^m])/m - (2*a*b*n*r*Log[x]*Log[-((f*x^m)/e)]*Log[e + f*x^m])/m + (b^2*n^2*r*Lo
g[x]^2*Log[-((f*x^m)/e)]*Log[e + f*x^m])/m - 2*a*b*r*Log[x]*Log[c*x^n]*Log[e + f*x^m] + 2*b^2*n*r*Log[x]^2*Log
[c*x^n]*Log[e + f*x^m] + (2*a*b*r*Log[-((f*x^m)/e)]*Log[c*x^n]*Log[e + f*x^m])/m - (2*b^2*n*r*Log[x]*Log[-((f*
x^m)/e)]*Log[c*x^n]*Log[e + f*x^m])/m - b^2*r*Log[x]*Log[c*x^n]^2*Log[e + f*x^m] + (b^2*r*Log[-((f*x^m)/e)]*Lo
g[c*x^n]^2*Log[e + f*x^m])/m + a^2*Log[x]*Log[d*(e + f*x^m)^r] - a*b*n*Log[x]^2*Log[d*(e + f*x^m)^r] + (b^2*n^
2*Log[x]^3*Log[d*(e + f*x^m)^r])/3 + 2*a*b*Log[x]*Log[c*x^n]*Log[d*(e + f*x^m)^r] - b^2*n*Log[x]^2*Log[c*x^n]*
Log[d*(e + f*x^m)^r] + b^2*Log[x]*Log[c*x^n]^2*Log[d*(e + f*x^m)^r] + (b*n*r*Log[x]*(-(b*n*Log[x]) + 2*(a + b*
Log[c*x^n]))*PolyLog[2, -(e/(f*x^m))])/m + (r*(a - b*n*Log[x] + b*Log[c*x^n])^2*PolyLog[2, 1 + (f*x^m)/e])/m +
 (2*a*b*n*r*PolyLog[3, -(e/(f*x^m))])/m^2 + (2*b^2*n*r*Log[c*x^n]*PolyLog[3, -(e/(f*x^m))])/m^2 + (2*b^2*n^2*r
*PolyLog[4, -(e/(f*x^m))])/m^3

________________________________________________________________________________________

Maple [F]
time = 0.03, size = 0, normalized size = 0.00 \[\int \frac {\left (a +b \ln \left (c \,x^{n}\right )\right )^{2} \ln \left (d \left (e +f \,x^{m}\right )^{r}\right )}{x}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*ln(c*x^n))^2*ln(d*(e+f*x^m)^r)/x,x)

[Out]

int((a+b*ln(c*x^n))^2*ln(d*(e+f*x^m)^r)/x,x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))^2*log(d*(e+f*x^m)^r)/x,x, algorithm="maxima")

[Out]

1/3*(b^2*n^2*log(x)^3 + 3*b^2*log(x)*log(x^n)^2 - 3*(b^2*n*log(c) + a*b*n)*log(x)^2 - 3*(b^2*n*log(x)^2 - 2*(b
^2*log(c) + a*b)*log(x))*log(x^n) + 3*(b^2*log(c)^2 + 2*a*b*log(c) + a^2)*log(x))*log((f*x^m + e)^r) - integra
te(-1/3*(3*(b^2*e*log(d) - (b^2*f*m*r*log(x) - b^2*f*log(d))*x^m)*log(x^n)^2 - (b^2*f*m*n^2*r*log(x)^3 - 3*b^2
*f*log(c)^2*log(d) - 6*a*b*f*log(c)*log(d) - 3*a^2*f*log(d) - 3*(b^2*f*m*n*r*log(c) + a*b*f*m*n*r)*log(x)^2 +
3*(b^2*f*m*r*log(c)^2 + 2*a*b*f*m*r*log(c) + a^2*f*m*r)*log(x))*x^m + 3*(b^2*log(c)^2*log(d) + 2*a*b*log(c)*lo
g(d) + a^2*log(d))*e + 3*((b^2*f*m*n*r*log(x)^2 + 2*b^2*f*log(c)*log(d) + 2*a*b*f*log(d) - 2*(b^2*f*m*r*log(c)
 + a*b*f*m*r)*log(x))*x^m + 2*(b^2*log(c)*log(d) + a*b*log(d))*e)*log(x^n))/(f*x*x^m + x*e), x)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 405 vs. \(2 (142) = 284\).
time = 0.37, size = 405, normalized size = 2.70 \begin {gather*} \frac {b^{2} m^{3} n^{2} \log \left (d\right ) \log \left (x\right )^{3} - 6 \, b^{2} n^{2} r {\rm polylog}\left (4, -f x^{m} e^{\left (-1\right )}\right ) + 3 \, {\left (b^{2} m^{3} n \log \left (c\right ) + a b m^{3} n\right )} \log \left (d\right ) \log \left (x\right )^{2} + 3 \, {\left (b^{2} m^{3} \log \left (c\right )^{2} + 2 \, a b m^{3} \log \left (c\right ) + a^{2} m^{3}\right )} \log \left (d\right ) \log \left (x\right ) - 3 \, {\left (b^{2} m^{2} n^{2} r \log \left (x\right )^{2} + b^{2} m^{2} r \log \left (c\right )^{2} + 2 \, a b m^{2} r \log \left (c\right ) + a^{2} m^{2} r + 2 \, {\left (b^{2} m^{2} n r \log \left (c\right ) + a b m^{2} n r\right )} \log \left (x\right )\right )} {\rm Li}_2\left (-{\left (f x^{m} + e\right )} e^{\left (-1\right )} + 1\right ) + {\left (b^{2} m^{3} n^{2} r \log \left (x\right )^{3} + 3 \, {\left (b^{2} m^{3} n r \log \left (c\right ) + a b m^{3} n r\right )} \log \left (x\right )^{2} + 3 \, {\left (b^{2} m^{3} r \log \left (c\right )^{2} + 2 \, a b m^{3} r \log \left (c\right ) + a^{2} m^{3} r\right )} \log \left (x\right )\right )} \log \left (f x^{m} + e\right ) - {\left (b^{2} m^{3} n^{2} r \log \left (x\right )^{3} + 3 \, {\left (b^{2} m^{3} n r \log \left (c\right ) + a b m^{3} n r\right )} \log \left (x\right )^{2} + 3 \, {\left (b^{2} m^{3} r \log \left (c\right )^{2} + 2 \, a b m^{3} r \log \left (c\right ) + a^{2} m^{3} r\right )} \log \left (x\right )\right )} \log \left ({\left (f x^{m} + e\right )} e^{\left (-1\right )}\right ) + 6 \, {\left (b^{2} m n^{2} r \log \left (x\right ) + b^{2} m n r \log \left (c\right ) + a b m n r\right )} {\rm polylog}\left (3, -f x^{m} e^{\left (-1\right )}\right )}{3 \, m^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))^2*log(d*(e+f*x^m)^r)/x,x, algorithm="fricas")

[Out]

1/3*(b^2*m^3*n^2*log(d)*log(x)^3 - 6*b^2*n^2*r*polylog(4, -f*x^m*e^(-1)) + 3*(b^2*m^3*n*log(c) + a*b*m^3*n)*lo
g(d)*log(x)^2 + 3*(b^2*m^3*log(c)^2 + 2*a*b*m^3*log(c) + a^2*m^3)*log(d)*log(x) - 3*(b^2*m^2*n^2*r*log(x)^2 +
b^2*m^2*r*log(c)^2 + 2*a*b*m^2*r*log(c) + a^2*m^2*r + 2*(b^2*m^2*n*r*log(c) + a*b*m^2*n*r)*log(x))*dilog(-(f*x
^m + e)*e^(-1) + 1) + (b^2*m^3*n^2*r*log(x)^3 + 3*(b^2*m^3*n*r*log(c) + a*b*m^3*n*r)*log(x)^2 + 3*(b^2*m^3*r*l
og(c)^2 + 2*a*b*m^3*r*log(c) + a^2*m^3*r)*log(x))*log(f*x^m + e) - (b^2*m^3*n^2*r*log(x)^3 + 3*(b^2*m^3*n*r*lo
g(c) + a*b*m^3*n*r)*log(x)^2 + 3*(b^2*m^3*r*log(c)^2 + 2*a*b*m^3*r*log(c) + a^2*m^3*r)*log(x))*log((f*x^m + e)
*e^(-1)) + 6*(b^2*m*n^2*r*log(x) + b^2*m*n*r*log(c) + a*b*m*n*r)*polylog(3, -f*x^m*e^(-1)))/m^3

________________________________________________________________________________________

Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*ln(c*x**n))**2*ln(d*(e+f*x**m)**r)/x,x)

[Out]

Exception raised: TypeError >> Invalid comparison of non-real zoo

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))^2*log(d*(e+f*x^m)^r)/x,x, algorithm="giac")

[Out]

integrate((b*log(c*x^n) + a)^2*log((f*x^m + e)^r*d)/x, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\ln \left (d\,{\left (e+f\,x^m\right )}^r\right )\,{\left (a+b\,\ln \left (c\,x^n\right )\right )}^2}{x} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((log(d*(e + f*x^m)^r)*(a + b*log(c*x^n))^2)/x,x)

[Out]

int((log(d*(e + f*x^m)^r)*(a + b*log(c*x^n))^2)/x, x)

________________________________________________________________________________________